<template>
	<view>

		<image class="head" src="@/static/hBg.png"></image>
		<uni-card>
			<!-- <image src=""></image> -->
			<view class="v_center" style="margin-top: 100rpx;">
				<image class="img_w_h" src="/static/success.png"></image>
				<view class="up_bottom" style="font-size: 36rpx;font-weight: 600;">
					{{form?(form.type == '汽车维修'?'预约成功：':'订购成功'):''}}</view>
			</view>

			<view class="v_center" style="margin-top: 100rpx;">
				<text style="font-weight: 600;">{{form?((form.type == '汽车维修'?'预约编号：':'订单编号')+id):''}}</text>
			</view>
			<u-button style="margin-top: 100rpx;" @click="toStart" shape="circle" type="primary">返回首页</u-button>
			<u-button class="up_top" @click="toDetail" shape="circle" type="success">查看详情</u-button>
			<view style="height: 100rpx;"></view>
		</uni-card>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '10086',
				form: null

			}
		},
		onLoad(e) {
			console.log(e);
			if (e.form != null) {
				this.form = JSON.parse(e.form)
				if (this.form.id != null) {
					this.id = this.form.id
				}
			}

		},
		methods: {
			toStart() {
				console.log('返回首页')
				// 返回首页
				uni.switchTab({
					url:'/pages/kk/shouye/shouye'
				});
			},
			toDetail() {
				// 
				let form = {}
				form.id = this.form.id
				form.type = this.form.type
				// 跳转预约详情
				if (form.type == '汽车维修') {
					uni.navigateTo({
						url: '/pages/yunRang/carMaintainReservation/cmr_detail/cmr_detail?form=' + JSON.stringify(
							form)
					})
				} else {
					uni.navigateTo({
						url: '/pages/kk/dingdanxiangqing/dingdanxiangqing?form=' + JSON.stringify(form)
					})
				}

			}
		}
	}
</script>

<style scoped lang="scss">
	.head {
		position: absolute;
		z-index: 0;
		width: 100%;
		margin-top: -50rpx;
	}

	.flex {
		display: flex;
	}

	.up_top {
		margin-top: 10rpx;
	}

	.v_center {
		width: 600rpx;
		text-align: center;
	}

	.img_w_h {
		width: 150rpx;
		height: 150rpx
	}
</style>